package com.ht.base.system.biz.client.impl;

import com.ht.base.system.biz.manager.SysMenuManager;
import com.ht.base.system.client.SysMenuClient;
import com.ht.base.system.common.pojo.bo.SysMenuBO;
import org.base.common.appexception.AppException;
import org.base.common.appexception.ResultData;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author hdengxian
 * @Date 2023/8/15 17:18
 */
@DubboService
@Component
public class SysMenuClientImpl implements SysMenuClient {
    @Resource
    private SysMenuManager sysMenuManager;
    
    @Override
    public ResultData<Boolean> insertMenu(SysMenuBO menuBO) throws AppException {
        return new ResultData<>(sysMenuManager.insertMenu(menuBO));
    }

    @Override
    public ResultData<Boolean> updateMenu(SysMenuBO menuBO) throws AppException {
        return new ResultData<>(sysMenuManager.updateMenu(menuBO));
    }

    @Override
    public ResultData<Boolean> delMenu(Long sysMenuId) throws AppException {
        return new ResultData<>(sysMenuManager.delMenu(sysMenuId));
    }

    @Override
    public ResultData<List<SysMenuBO>> findMenuByIdList(List<Long> menus) throws AppException {
        return new ResultData<>(sysMenuManager.findMenuByIdList(menus));
    }
}
